# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=chronoleak
pkgver=0.0.1
pkgrel=2
pkgdesc='ICMP Timestamp Remote Time Leaker.'
arch=('any')
groups=('blackarch' 'blackarch-recon')
url='https://github.com/noraj/ChronoLeak'
license=('MIT')
depends=('ruby' 'hping')
source=("https://rubygems.org/downloads/$pkgname-$pkgver.gem")
noextract=("$pkgname-$pkgver.gem")
sha512sums=('3880f55a8112e00e40430dfa837142837d58bd84e0357e1afe01af207244b88c44a4bfe5e44d9063ac9fc72530f4e109b97c028ca5d299c226da2c83f613d9d3')

package() {
  _gemhome="$(gem env home)"

  gem install --ignore-dependencies --no-user-install --no-document \
    --no-wrapper -i "$pkgdir/$_gemhome" \
    -n "$pkgdir/usr/bin" "$pkgname-$pkgver.gem"

  rm "$pkgdir/$_gemhome/cache/$pkgname-$pkgver.gem"

  find "$pkgdir/$_gemhome/extensions/" -name *.so -delete

  install -Dm 644 "$pkgdir/$_gemhome/gems/$pkgname-$pkgver/LICENSE" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

